<%@ page import="java.io.IOException" %><%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2019/12/6
  Time: 17:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%-- 使用表达式打印99乘法表 --%>
<%!
   String multTable(){
       String s="";
       for(int i=1;i<=9;i++){
             for (int j=1;j<=i;j++){
                 s=s+i+"*"+j+"="+i*j+"&nbsp;&nbsp;&nbsp;&nbsp";
             }
           s=s+"<br>";

       }
       return s;
   }
   %>
<%!
    void multTable2(JspWriter out )throws IOException{
    for(int i=1;i<=9;i++){
        for (int j=1;j<=i;j++){
            out.print(i+"*"+j+"="+i*j+"&nbsp;&nbsp;&nbsp;&nbsp");
        }
        out.println("<br><br>");

    }

}
 %>

<h1>打印99乘法表</h1>
<hr>
<%= multTable()%>
<% multTable2(out);%>
</body>
</html>
